/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package fr.uvsq.isty.bdh.hchess.gui.menu;

import fr.uvsq.isty.bdh.hchess.gui.MainWindow;
import fr.uvsq.isty.bdh.hchess.interfacing.IChessPlayer;
import java.awt.Dimension;
import javax.swing.JPanel;


/**
 *
 * @author Clement Bellot <clementbellot@gmail.com>
 */
public class PlayersSelectPannel extends JEmptyPanel{
    private MainWindow mainWindow;
    private PlayerOrIASelectFrame whitePlayerChoice;
    private PlayerOrIASelectFrame blackPlayerChoice;
    private JPanel centerSpacing;
    PlayersSelectPannel(MainWindow mainWindow){
        this.mainWindow = mainWindow;
        
        whitePlayerChoice = new PlayerOrIASelectFrame(mainWindow,false);
        blackPlayerChoice = new PlayerOrIASelectFrame(mainWindow,true);
        
        centerSpacing = new JEmptyPanel();
        centerSpacing.setPreferredSize(new Dimension(100,0));
        this.add(whitePlayerChoice);
        this.add(centerSpacing);
        this.add(blackPlayerChoice);
    }
    public IChessPlayer getWhitePlayer(){
        return whitePlayerChoice.getPlayer();
    }
    public IChessPlayer getBlackPlayer(){
        return blackPlayerChoice.getPlayer();
    }
}
